import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
    plugins: [vue()],
    server: {
        // 代理配置
        proxy: {
            // 匹配以 /employee 开头的请求
            '/employee': {
                // 后端服务地址
                target: 'http://localhost:8080',
                // 允许跨域
                changeOrigin: true
            },
            '/category': {
                target: 'http://localhost:8080',
                changeOrigin: true
            },
            '/dish': {
                target: 'http://localhost:8080',
                changeOrigin: true
            },
            '/table': {
                target: 'http://localhost:8080',
                changeOrigin: true
            },
            '/order': {
                target: 'http://localhost:8080',
                changeOrigin: true
            }
        }
    }
})